export default [
  {
    type: 'radio-button',
    label: '申请门槛',
    valueKey: 'applyType',
    defaultValue: 1,
    options: [
      { label: '无门槛', value: 1 },
      { label: '购买指定商品', value: 2 },
    ],
  },
  {
    type: 'radio-button',
    label: '计算类型',
    valueKey: 'countType',
    defaultValue: 1,
    hidden: 'modelForm =_| modelForm.applyType == 1',
    options: [
      { label: '按比例', value: 1 },
      { label: '固定金额', value: 2 },
    ],
  },
  {
    type: 'input-number',
    label: '直推奖励金额',
    valueKey: 'price',
    hidden: 'modelForm =_| modelForm.applyType == 1',
    customComponentOptions: modelForm => {
      const max = Math.max(...modelForm.list.map(item => item.goodsPrice))
      return {
        max,
      }
    },
    defaultValue: 0,
    formItemProps: { extra: '' },
  },

  {
    type: 'custom',
    label: '选择商品',
    hidden: 'modelForm =_| modelForm.applyType == 1',

    valueKey: 'list',
    component: 'PlaceGoodsList',
    defaultValue: [],
  },
]
